<template>
  <view class="oa-content">
    <!-- 顶部自定义导航 -->
    <tn-nav-bar fixed customBack :bottomShadow="false" backgroundColor="#FFFFFF">
      <view slot="back" class='tn-custom-nav-bar__back'
        @click="goBack">
        <text class='icon tn-icon-left-arrow'></text>
      </view>
      <view class="tn-flex tn-flex-col-center tn-flex-row-center ">
        <text class="tn-text-bold tn-text-xl tn-color-black">发起群聊</text>
      </view>
    </tn-nav-bar>

    <!-- 页面内容 -->
    <view class="" :style="{paddingTop: vuex_custom_bar_height + 10 +'px'}">
      
      
     <view class="tn-padding tn-flex tn-flex-col-between tn-strip-bottom-min" @click="tn('')">
        <view class="icon15__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-color-white" style="background-color: #00C8B0;">
          <view class="tn-icon-menu-match"></view>
        </view>
        <view class="tn-flex tn-flex-row-left tn-flex-col-center">
          <view class="justify-content-item tn-margin-sm tn-text-bold tn-text-lg">
            <text>面对面建群</text>
          </view>
        </view>
      </view>
      
      <tn-index-list :scrollTop="scrollTop" :indexList="indexList" :customBarHeight="vuex_custom_bar_height" :sticky="false" :key-list-offset-top="54" :stickyTop="vuex_custom_bar_height">
        <view v-for="(item, index) in list" :key="index">
          <tn-index-anchor :index="item.letter"></tn-index-anchor>
          <view v-for="(data_item,data_index) in item.data" :key="data_index" class="">
              <view class="tn-flex tn-flex-col-center" style="margin: 50rpx 30rpx;">
                <!-- 未选择 -->
                <view class="tn-padding-right">
                  <view class="tn-icon-circle tn-text-xl tn-color-gray"></view>
                </view>
                <!-- 选择 -->
                <!-- <view class="tn-padding-right">
                  <view class="tn-icon-circle-fill tn-text-xl" style="color: #00C8B0;"></view>
                </view> -->
                <view class="">
                  <view class="logo-pic">
                    <view class="logo-image" :style="'background-image:url(' + data_item.url + ');width: 90rpx;height: 90rpx;background-size: cover;'">
                    </view>
                  </view>
                </view>
                <view class="tn-padding-left-sm" style="width: 100%;">
                  <view class="tn-flex tn-flex-col-center">
                    <view class="justify-content-item">
                      <text class="tn-text-lg tn-text-bold">{{ data_item.name }}</text>
                    </view>
                  </view>
                  <!-- <view class="tn-padding-top-xs tn-text-ellipsis">
                    <text class="tn-color-gray">{{ data_item.job }}</text>
                  </view> -->
                </view>
                <!-- <view class="">
                  <text class="tn-color-gray tn-text-lg tn-icon-right"></text>
                </view> -->
              </view>
              
            </view>
          
          
          
          
        </view>
      </tn-index-list>

    </view>
    
    <!-- 悬浮按钮-->
    <view class="tn-flex tn-footerfixed tn-padding">
      <view class="tn-flex-1 justify-content-item tn-text-center">
        <tn-button backgroundColor="#00C8B0 " padding="40rpx 0" width="60%" :fontSize="28" fontColor="#FFFFFF" shape="round" @click="tn('/workPages/prompt')">
          <text class="">创建群聊</text>
        </tn-button>
      </view>
    </view>
    
    <view class="tn-tabbar-height"></view>

  </view>

</template>

<script>
  import template_page_mixin from '@/libs/mixin/template_page_mixin.js'
  import indexList from '../libs/index.list.js'
  const letterArr = indexList.list.map(val => {
    return val.letter
  })
  export default {
    name: 'Friends',
    mixins: [template_page_mixin],
    data() {
      return {
        // 滚动的距离
        scrollTop: 0,
        // 索引列表
        indexList: letterArr,
        list: indexList.list
      }
    },
    onPageScroll(e) {
      this.scrollTop = e.scrollTop
    },
    methods: {
      // 跳转
      tn(e) {
        uni.navigateTo({
          url: e,
        });
      },
    }

  }
</script>

<style lang="scss" scoped>
  /* 胶囊*/
  .tn-custom-nav-bar__back {
    z-index: 9999;
    width: 60%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 1000rpx;
    border: 1rpx solid rgba(255, 255, 255, 0.5);
    color: #FFFFFF;
    font-size: 32rpx;
    
    .icon {
      display: block;
      flex: 1;
      margin: auto;
      text-align: center;
    }
    
  }
  .oa-content{
    max-width: 640px;
    margin: 0 auto;
    // background-color: #F8F7F8;
    min-height: 100vh;
    padding-bottom: 60rpx;
    padding-bottom: calc(80rpx + env(safe-area-inset-bottom) / 2);
    padding-bottom: calc(80rpx + constant(safe-area-inset-bottom));
  }
  
  /* 用户头像 start */
  .logo-image {
    width: 90rpx;
    height: 90rpx;
    position: relative;
  }
  
  .logo-pic {
    background-size: cover;
    background-repeat: no-repeat;
    // background-attachment:fixed;
    background-position: center;
    // border: 1rpx solid rgba(255,255,255,0.05);
    // box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.15);
    border-radius: 100rpx;
    overflow: hidden;
    // background-color: #FFFFFF;
  }
  
  /* 图标容器15 start */
  .icon15 {
    &__item {
      width: 30%;
      background-color: #FFFFFF;
      padding: 30rpx;
      margin: 20rpx 10rpx;
      transform: scale(1);
      transition: transform 0.3s linear;
      transform-origin: center center;
      
      &--icon {
        width: 80rpx;
        height: 80rpx;
        font-size: 50rpx;
        border-radius: 50%;
        position: relative;
        z-index: 1;
        
        &::after {
          content: " ";
          position: absolute;
          z-index: -1;
          width: 100%;
          height: 100%;
          left: 0;
          bottom: 0;
          border-radius: inherit;
          opacity: 1;
          transform: scale(1, 1);
          background-size: 100% 100%;
  
            
        }
      }
    }
  }
  
  /* 底部悬浮按钮 start*/
  .tn-tabbar-height {
  	min-height: 160rpx;
  	height: calc(180rpx + env(safe-area-inset-bottom) / 2);
    height: calc(180rpx + constant(safe-area-inset-bottom));
  }
  .tn-footerfixed {
    max-width: 640px;
    margin: 0 auto;
    position: fixed;
    width: 100%;
    bottom: calc(40rpx + env(safe-area-inset-bottom));
    z-index: 1024;
    box-shadow: 0 1rpx 6rpx rgba(0, 0, 0, 0);
  }
  /* 底部悬浮按钮 end*/
</style>
